I am using a web browser control to display some PPT slides saved as HTML. My
client has recently asked that the background of the browser be changed to
sonething other than white so that the slides "standout". I've tried setting
the browser's BackColor setting, but that had no effect at run time. Any
suggestions on how to control the default back color of content displayed in
a web browser control? 9 13674
FYI, Also I've tried changing the back color in the PPT slides before
converting them to HTML - that works for the slide background but the space
around the slide is still white...
"hz****@nopost.com" wrote: I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:3D**********************************@microsof t.com... I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
My web browser is part of my GUI... here's how its declared:
Friend WithEvents browser As AxSHDocVw.AxWebBrowser
So, when I tried
Me.browser.Document.bgColor = Color.Red
or
Me.browser.Document.body.style.backgroundColor = Color.Rad
I got a run time error. The only method that looks to be available under the
Document object is GetType.
Any other suggestions?
"Charles Law" wrote: You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:3D**********************************@microsof t.com...I am using a web browser control to display some PPT slides saved as HTML. My client has recently asked that the background of the browser be changed to sonething other than white so that the slides "standout". I've tried setting the browser's BackColor setting, but that had no effect at run time. Any suggestions on how to control the default back color of content displayed in a web browser control?
Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red,
Color))
Note that because these methods use the document attribute, they must be
called when the document has been loaded, either in the DocumentComplete
event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:DD**********************************@microsof t.com... My web browser is part of my GUI... here's how its declared: Friend WithEvents browser As AxSHDocVw.AxWebBrowser
So, when I tried Me.browser.Document.bgColor = Color.Red or Me.browser.Document.body.style.backgroundColor = Color.Rad
I got a run time error. The only method that looks to be available under the Document object is GetType.
Any other suggestions?
"Charles Law" wrote:
You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:3D**********************************@microsof t.com... >I am using a web browser control to display some PPT slides saved as >HTML. >My > client has recently asked that the background of the browser be changed > to > sonething other than white so that the slides "standout". I've tried > setting > the browser's BackColor setting, but that had no effect at run time. > Any > suggestions on how to control the default back color of content > displayed > in > a web browser control?
Thanks for the reply, but I get compile error:
When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not defined" -
Is there an Import statement that I am missing?
Thanks for your attention to this matter!
"Charles Law" wrote: Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red, Color))
Note that because these methods use the document attribute, they must be called when the document has been loaded, either in the DocumentComplete event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... My web browser is part of my GUI... here's how its declared: Friend WithEvents browser As AxSHDocVw.AxWebBrowser
So, when I tried Me.browser.Document.bgColor = Color.Red or Me.browser.Document.body.style.backgroundColor = Color.Rad
I got a run time error. The only method that looks to be available under the Document object is GetType.
Any other suggestions?
"Charles Law" wrote:
You could use
AxWebBrowser1.Document.bgColor = "..."
or
AxWebBrowser1.Document.body.style.backgroundColor = "..."
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:3D**********************************@microsof t.com... >I am using a web browser control to display some PPT slides saved as >HTML. >My > client has recently asked that the background of the browser be changed > to > sonething other than white so that the slides "standout". I've tried > setting > the browser's BackColor setting, but that had no effect at run time. > Any > suggestions on how to control the default back color of content > displayed > in > a web browser control?
There is an import that you could use, but I do not recommend using it
because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in
your References. Right-click the References section in the solution explorer
and select Add Reference. Then add a reference to Microsoft.mshtml from the
list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:CF**********************************@microsof t.com... Thanks for the reply, but I get compile error: When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not defined" - Is there an Import statement that I am missing?
Thanks for your attention to this matter!
"Charles Law" wrote:
Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red, Color))
Note that because these methods use the document attribute, they must be called when the document has been loaded, either in the DocumentComplete event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... > My web browser is part of my GUI... here's how its declared: > Friend WithEvents browser As AxSHDocVw.AxWebBrowser > > So, when I tried > Me.browser.Document.bgColor = Color.Red > or > Me.browser.Document.body.style.backgroundColor = Color.Rad > > I got a run time error. The only method that looks to be available > under > the > Document object is GetType. > > Any other suggestions? > > > "Charles Law" wrote: > >> You could use >> >> AxWebBrowser1.Document.bgColor = "..." >> >> or >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:3D**********************************@microsof t.com... >> >I am using a web browser control to display some PPT slides saved as >> >HTML. >> >My >> > client has recently asked that the background of the browser be >> > changed >> > to >> > sonething other than white so that the slides "standout". I've >> > tried >> > setting >> > the browser's BackColor setting, but that had no effect at run time. >> > Any >> > suggestions on how to control the default back color of content >> > displayed >> > in >> > a web browser control? >> >> >>
Very good, I was missing the Reference...
So, I implemented he code you suggested below in my methods that "...Handles
browser.DocumentComplete"...
Problem is that my results are still the same - when I load up the HTML, the
background outside the converted PPT slide is still white...
Thanks for your help thus far!
"Charles Law" wrote: There is an import that you could use, but I do not recommend using it because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in your References. Right-click the References section in the solution explorer and select Add Reference. Then add a reference to Microsoft.mshtml from the list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... Thanks for the reply, but I get compile error: When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not defined" - Is there an Import statement that I am missing?
Thanks for your attention to this matter!
"Charles Law" wrote:
Option Strict On
....
Dim doc As mshtml.IHTMLDocument2
doc = DirectCast(browser, mshtml.IHTMLDocument2)
doc.bgColor = "Red"
or
doc.body.style.backgroundColor = ColorTranslator.ToHtml(CType(Color.Red, Color))
Note that because these methods use the document attribute, they must be called when the document has been loaded, either in the DocumentComplete event or after it has fired.
HTH
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:DD**********************************@microsof t.com... > My web browser is part of my GUI... here's how its declared: > Friend WithEvents browser As AxSHDocVw.AxWebBrowser > > So, when I tried > Me.browser.Document.bgColor = Color.Red > or > Me.browser.Document.body.style.backgroundColor = Color.Rad > > I got a run time error. The only method that looks to be available > under > the > Document object is GetType. > > Any other suggestions? > > > "Charles Law" wrote: > >> You could use >> >> AxWebBrowser1.Document.bgColor = "..." >> >> or >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:3D**********************************@microsof t.com... >> >I am using a web browser control to display some PPT slides saved as >> >HTML. >> >My >> > client has recently asked that the background of the browser be >> > changed >> > to >> > sonething other than white so that the slides "standout". I've >> > tried >> > setting >> > the browser's BackColor setting, but that had no effect at run time. >> > Any >> > suggestions on how to control the default back color of content >> > displayed >> > in >> > a web browser control? >> >> >>
Are you certain that the border is not part of the converted slide?
You could also try posting this to
microsoft.public.inetsdk.programming.webbrowser_ct l, where Igor lives.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in
message news:CF**********************************@microsof t.com... Very good, I was missing the Reference...
So, I implemented he code you suggested below in my methods that "...Handles browser.DocumentComplete"...
Problem is that my results are still the same - when I load up the HTML, the background outside the converted PPT slide is still white...
Thanks for your help thus far!
"Charles Law" wrote:
There is an import that you could use, but I do not recommend using it because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in your References. Right-click the References section in the solution explorer and select Add Reference. Then add a reference to Microsoft.mshtml from the list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... > Thanks for the reply, but I get compile error: > When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not > defined" - > Is there an Import statement that I am missing? > > Thanks for your attention to this matter! > > > "Charles Law" wrote: > >> Option Strict On >> >> .... >> >> Dim doc As mshtml.IHTMLDocument2 >> >> doc = DirectCast(browser, mshtml.IHTMLDocument2) >> >> doc.bgColor = "Red" >> >> or >> >> doc.body.style.backgroundColor = >> ColorTranslator.ToHtml(CType(Color.Red, >> Color)) >> >> >> Note that because these methods use the document attribute, they must >> be >> called when the document has been loaded, either in the >> DocumentComplete >> event or after it has fired. >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:DD**********************************@microsof t.com... >> > My web browser is part of my GUI... here's how its declared: >> > Friend WithEvents browser As AxSHDocVw.AxWebBrowser >> > >> > So, when I tried >> > Me.browser.Document.bgColor = Color.Red >> > or >> > Me.browser.Document.body.style.backgroundColor = Color.Rad >> > >> > I got a run time error. The only method that looks to be available >> > under >> > the >> > Document object is GetType. >> > >> > Any other suggestions? >> > >> > >> > "Charles Law" wrote: >> > >> >> You could use >> >> >> >> AxWebBrowser1.Document.bgColor = "..." >> >> >> >> or >> >> >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> >> >> HTH >> >> >> >> Charles >> >> >> >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> >> >> wrote >> >> in >> >> message news:3D**********************************@microsof t.com... >> >> >I am using a web browser control to display some PPT slides saved >> >> >as >> >> >HTML. >> >> >My >> >> > client has recently asked that the background of the browser be >> >> > changed >> >> > to >> >> > sonething other than white so that the slides "standout". I've >> >> > tried >> >> > setting >> >> > the browser's BackColor setting, but that had no effect at run >> >> > time. >> >> > Any >> >> > suggestions on how to control the default back color of content >> >> > displayed >> >> > in >> >> > a web browser control? >> >> >> >> >> >> >> >> >>
No I'm not sure - being an HTML novice I'm not sure how to tell either... but
it looks like is now realted to the HTML, so I'll dig in an see is there's a
background colr being controled by the conversion of the PPT to HTML...
thanks for your help.
I'll repost this thread as you suggested.
"Charles Law" wrote: Are you certain that the border is not part of the converted slide?
You could also try posting this to microsoft.public.inetsdk.programming.webbrowser_ct l, where Igor lives.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... Very good, I was missing the Reference...
So, I implemented he code you suggested below in my methods that "...Handles browser.DocumentComplete"...
Problem is that my results are still the same - when I load up the HTML, the background outside the converted PPT slide is still white...
Thanks for your help thus far!
"Charles Law" wrote:
There is an import that you could use, but I do not recommend using it because it will slow down the intellisense down tremendously.
The fact that you get a compile error suggests that the assembly is not in your References. Right-click the References section in the solution explorer and select Add Reference. Then add a reference to Microsoft.mshtml from the list.
Charles
"hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote in message news:CF**********************************@microsof t.com... > Thanks for the reply, but I get compile error: > When I dimension "doc As mshtml.IHTMLDocument2" I get "...is not > defined" - > Is there an Import statement that I am missing? > > Thanks for your attention to this matter! > > > "Charles Law" wrote: > >> Option Strict On >> >> .... >> >> Dim doc As mshtml.IHTMLDocument2 >> >> doc = DirectCast(browser, mshtml.IHTMLDocument2) >> >> doc.bgColor = "Red" >> >> or >> >> doc.body.style.backgroundColor = >> ColorTranslator.ToHtml(CType(Color.Red, >> Color)) >> >> >> Note that because these methods use the document attribute, they must >> be >> called when the document has been loaded, either in the >> DocumentComplete >> event or after it has fired. >> >> HTH >> >> Charles >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> wrote >> in >> message news:DD**********************************@microsof t.com... >> > My web browser is part of my GUI... here's how its declared: >> > Friend WithEvents browser As AxSHDocVw.AxWebBrowser >> > >> > So, when I tried >> > Me.browser.Document.bgColor = Color.Red >> > or >> > Me.browser.Document.body.style.backgroundColor = Color.Rad >> > >> > I got a run time error. The only method that looks to be available >> > under >> > the >> > Document object is GetType. >> > >> > Any other suggestions? >> > >> > >> > "Charles Law" wrote: >> > >> >> You could use >> >> >> >> AxWebBrowser1.Document.bgColor = "..." >> >> >> >> or >> >> >> >> AxWebBrowser1.Document.body.style.backgroundColor = "..." >> >> >> >> HTH >> >> >> >> Charles >> >> >> >> >> >> "hz****@nopost.com" <hz*************@discussions.microsoft.com> >> >> wrote >> >> in >> >> message news:3D**********************************@microsof t.com... >> >> >I am using a web browser control to display some PPT slides saved >> >> >as >> >> >HTML. >> >> >My >> >> > client has recently asked that the background of the browser be >> >> > changed >> >> > to >> >> > sonething other than white so that the slides "standout". I've >> >> > tried >> >> > setting >> >> > the browser's BackColor setting, but that had no effect at run >> >> > time. >> >> > Any >> >> > suggestions on how to control the default back color of content >> >> > displayed >> >> > in >> >> > a web browser control? >> >> >> >> >> >> >> >> >> This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: msa |
last post by:
Hi there,
First off, let me say that I know that launching to full screen is a
bad idea. I would never do it given the choice, but I must follow
orders from my boss, the boss that desparately...
|
by: Nou Dadoun |
last post by:
I'm currently developing an application in C++/MFC (Visual Studio 6,
if that makes a difference) and I'd like to avoid the Windows style UI
widgets and dialogs if at all possible.
In fact, what...
|
by: Al Franz |
last post by:
Have done popup browsers from links before controlling width, height, menu
bars, etc. using javascript. But what if you want to control the parameters
of the initial browser window to open. Such...
|
by: max reason |
last post by:
I added the WebBrowser component to my toolbox,
then placed one on a form with other .NET components.
This much seems to have worked, but I do not understand
how to control the sucker from within...
|
by: hzgt9b |
last post by:
I am using a web browser control to display some PPT slides saved as HTML. My
client has recently asked that the background of the browser be changed to
sonething other than white so that the...
|
by: celoftis |
last post by:
BACKGROUND:
I have some PPT slides that have been converted to HTM (ensuring that
the show slide animations while browsing checkbox is checked). The
original HTM slides have custom animations to...
|
by: anil.rita |
last post by:
When the user chooses an AV file to play, based upon the type of file,
I want to use the default installed media player to play it.
I am wondering if this is a good way - any alternatives,...
|
by: =?Utf-8?B?UmljaA==?= |
last post by:
I have a web browser control (VB2005) in a panel on a form. I use it only to
open Reports from Reporting Services (sql Server 2000) or PDFs. So I am not
using the web browser control for browsing...
|
by: =?Utf-8?B?R3JlZw==?= |
last post by:
I am used to using third party controls when it comes to setting up
appearences. But, now I am using Visual Basic.Net controls that come standard
with the product. I've come across a frustration...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
| |